package yunquan.wang.modules.base.web;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import yunquan.wang.base.service.BaseService;
import yunquan.wang.base.web.BaseController;
import yunquan.wang.modules.base.entity.GroupType;
import yunquan.wang.modules.base.service.GroupTypeService;
@Controller
@RequestMapping("/core/grouptype")
public class GroupTypeController extends  BaseController<GroupType>{
	@Resource
	private GroupTypeService groupTypeService;
 
	@RequestMapping(value = "/list.do")
	public ModelAndView list(HttpServletRequest request) {
		return baseList();
	}

 
	@RequestMapping(value = "/save.do")
	public ModelAndView save(@Valid GroupType entity,
			BindingResult bindingResult) {
		return baseSave(entity,bindingResult);
	}

	/*
	 * 默认查看
	 */
	@RequestMapping(value = "/view.do")
	public ModelAndView view(String id) {
		return baseView();
	}

	/*
	 * 默认输入方法
	 */
	@RequestMapping(value = "/input.do")
	public ModelAndView input(String id) {
		return baseInput().addObject("allGroupType",groupTypeService.findAll());
	}

	/*
	 * 默认删除方法
	 */
	@RequestMapping(value = "/delete.do")
	public  ModelAndView delete(String id) {
		return baseDelete();
	}
	@Override
	public BaseService<GroupType> getService() {
		return groupTypeService;
	}
}
